#ifndef _COLLISIONAREA_H_
#define _COLLISIONAREA_H_
#include "vector2d.h"


class CollisionArea
{
public:
	enum GeomShape {CIRCLE = 0,LINE,RECT};
public:	

	virtual GeomShape Type() const = 0;	
	inline void SetPos(const vector2df& p) {m_pos = p;}
	inline const vector2df& Pos() const {return m_pos;}
	void SetName(const char* name);
	const char* GetName()const{return &m_name[0];}
	
protected:
	char		m_name[32];
	vector2df	m_pos;
	float		m_manhattanDist;
};

class ACircle: public CollisionArea
{
public:
	ACircle(){}
	GeomShape Type() const {return CIRCLE;}
	inline void SetDim(float rad) {m_radius = rad;}
	inline float Radius() const {return m_radius;}
	inline float Radius2() const {return (m_radius* m_radius);}
	inline float MaxY() const {return m_pos.Y + m_radius;}
	inline float MinY() const {return m_pos.Y - m_radius;}
private:
	float m_radius;
};


bool CircleCircleCollide(const ACircle& a0, const ACircle& a1);
bool PointInCircle(const vector2df& p, const ACircle& a1);
#endif